//PART-1
var renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );

var camera = new THREE.PerspectiveCamera( 45, window.innerWidth / window.innerHeight, 1, 500 );
camera.position.set( 0, 0, 100 );
camera.lookAt( 0, 0, 0 );

var scene = new THREE.Scene();


//PART-2:create a blue LineBasicMaterial
var material = new THREE.LineBasicMaterial( { color: 0xffffff } );

//PART-3:
var points = [];
points.push( new THREE.Vector3( - 10, 0, 0 ) );
points.push( new THREE.Vector3( 0, 10, 0 ) );
points.push( new THREE.Vector3( 10, 0, 0 ) );


//PART-4 将我们设置的顶点传入缓存区。
var geometry = new THREE.BufferGeometry().setFromPoints( points );

//PART-5 LINE表示绘图方式，参数相当于WebGL的 顶点和片元 数据
var line = new THREE.Line( geometry, material );

//PART-6 完工！
scene.add( line );
renderer.render( scene, camera );